#include "interface.h"
#include "Expressions.h"

#include <string>

void* root;
void* deltaTheta;
void* deltaPhi;
void* rgb[3];

void* newVariable(char* str) {
	return new Variable(std::string(str));
}

void* newConstant(double constant) {
	return new Constant(constant);
}

void* newPlus(void* left, void* right) {
	return new Plus((Expression*)left, (Expression*)right);
}

void* newMinus(void* left, void* right) {
	return new Minus((Expression*)left, (Expression*)right);
}

void* newMultiply(void* left, void* right) {
	return new Multiply((Expression*)left, (Expression*)right);
}

void* newDivide(void* left, void* right) {
	return new Divide((Expression*)left, (Expression*)right);
}

void* newSin(void* left) {
	return new Sin((Expression*)left);
}

void* newCos(void* left) {
	return new Cos((Expression*)left);
}

void* newLn(void* left) {
	return new Ln((Expression*)left);
}

void* newLog(void* left) {
	return new Log((Expression*)left);
}

void* newExp(void* left) {
	return new Exp((Expression*)left);
}

void* newAbs(void* left) {
	return new Abs((Expression*) left);
}

void* newPow(void* left, void* right) {
	return new Pow((Expression*)left, (Expression*) right);
}

void* getRoot() {
	return root;
}

void setRoot(void* otherRoot) {
	root = otherRoot;
}

void* getDeltaTheta() {
	return deltaTheta;
}

void setDeltaTheta(void* otherDelta) {
	deltaTheta = otherDelta;
}

void* getDeltaPhi() {
	return deltaPhi;
}

void setDeltaPhi(void* otherDelta) {
	deltaPhi = otherDelta;
}

void** getRgb() {
	return rgb;
}

void setRgb(void* otherRgb[3]) {
	for(int i=0;i<3;i++)
		rgb[i] = otherRgb[i];
}
